nanopyx.liquid._le_roberts_cross_gradients
Base class for parts of the Nanopyx Liquid Engine Vroom Vroom
Initialize the Liquid Engine The Liquid Engine base class is inherited by children classes that implement specific methods
Engine responsabilities:
- Store implemented run types;
- Handle previous benchmarks and I/O;
- When queried, benchmark all available run types;
- Run a specific method using a selected run type;
Benchmark files have the following format:
The benchmark file is read as dict of dicts.
BENCHMARK DICT FOR A SPECIFIC METHOD
|- RUN_TYPE #1
| |- ARGS_REPR #1
| | |- [score, t2run#1, t2run#2, t2run#3, ...] last are newer. nan means fail
| |- ARGS_REPR #2
| | |- [score, t2run#1, t2run#2, t2run#3, ...] last are newer. nan means fail
| (...)
|- RUN_TYPE #2
(...)
- Run each available run type and record the run time and return value
- Sort the run times from fastest to slowest
- Compare each run type against each other, sorted by speed
Parameters
- args: args for the run method
- kwargs: kwargs for the run method
Returns
a list of tuples containing the run time, run type name and optionally the return values